<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
  <head>
    <title>jQuery Template JSP</title>
    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
  </head>
  
  <body>
  	test
	<table id="gridCustomer"></table>
	<div id="pgridCustomer"></div>
  </body>
  
	<script type="text/javascript">
		jQuery(function($) {
			var $jqGrid = $("#gridCustomer").jqGrid({
				url:'test/test-customer!list4JSON.action',
				datatype: "json",
				height: 100,
				rowNum: 20,
				rowList: [10,20,30],
			   	colNames:['Inv No','用户名', '姓名', '邮箱','手机','状态','IP','最后登录时间','餐币'],
			   	colModel:[
			   		{name:'id',index:'id', width:60, sorttype:"int"},
			   		{name:'username',index:'username', width:90, sorttype:"date", formatter:"date"},
			   		{name:'name',index:'name', width:100},
			   		{name:'email',index:'email', width:80, align:"right",sorttype:"float", formatter:"number"},
			   		{name:'phone',index:'phone', width:80, align:"right",sorttype:"float"},		
			   		{name:'locked',index:'locked', width:80,align:"right",sorttype:"float"},		
			   		{name:'loginIP',index:'loginIP', width:150, sortable:false},	
			   		{name:'lastLoginTime',index:'lastLoginTime', width:150, sortable:false},
			   		{name:'integralSum',index:'integralSum', width:150, sortable:false}	
			   	],
			   	pager: "#pgridCustomer",
			   	viewrecords: true,
			   	sortname: 'username',
			   	caption: "客户列表"
			});
			
			
			$jqGrid.jqGrid('setGridParam',{ 
			    beforeRequest: function() {
					//blockUI();
				},
				serializeGridData: function(postData){
					return postData;
				},
				loadComplete: function(data){
					//$(".ui-layout-west, #mainContent").unblock();
					console.log(data);
				},
				loadError: function(xhr,status,error) {
					//$(".ui-layout-west, #mainContent").unblock();
					alert(error);
				}
			});
			
			
		});

	</script>

 
</html>
